home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume22 / nn6.4 / part04 < prev    next >
Encoding:
Internet Message Format  |  1990-06-07  |  54.6 KB

  1. Subject:  v22i039:  NN Newsreader, release 6.4, Part04/21
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 0529026a 1e3a6086 a2dc298d 1ee726bc
  5.  
  6. Submitted-by: "Kim F. Storm" <storm@texas.dk>
  7. Posting-number: Volume 22, Issue 39
  8. Archive-name: nn6.4/part04
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then feed it
  12. # into a shell via "sh file" or similar.  To overwrite existing files,
  13. # type "sh file -c".
  14. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  15. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  16. # Contents:  global.c man/nn.1.D
  17. # Wrapped by storm@texas.dk on Sun May  6 18:19:22 1990
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. echo If this archive is complete, you will see the following message:
  20. echo '          "shar: End of archive 4 (of 22)."'
  21. if test -f 'global.c' -a "${1}" != "-c" ; then 
  22.   echo shar: Will not clobber existing file \"'global.c'\"
  23. else
  24.   echo shar: Extracting \"'global.c'\" \(12323 characters\)
  25.   sed "s/^X//" >'global.c' <<'END_OF_FILE'
  26. X/*
  27. X *    (c) Copyright 1990, Kim Fabricius Storm.  All rights reserved.
  28. X *
  29. X *    Global declarations and auxiliary functions.
  30. X */
  31. X
  32. X#include <signal.h>
  33. X#include <errno.h>
  34. X#include <pwd.h>
  35. X#include "config.h"
  36. X#include "patchlevel.h"
  37. X
  38. Xexport char *home_directory;
  39. Xexport char *nn_directory;        /* ~/.nn */
  40. Xexport char *news_directory;        /* /usr/spool/news */
  41. Xexport char *news_lib_directory;     /* /usr/lib/news */
  42. Xexport char *lib_directory;        /* /usr/local/lib/nn */
  43. Xexport char *master_directory;        /* = lib */
  44. Xexport char *help_directory;        /* = lib/help */
  45. Xexport char *bin_directory = BIN_DIRECTORY;
  46. X
  47. Xexport char *db_directory;    /* /usr/spool/nn or NEWS_DIR/.nn */
  48. Xexport char *db_data_directory;    /* ..../DATA     or undefined    */
  49. X
  50. Xexport char *news_active;    /* NLIB/active or DB/ACTIVE */
  51. X
  52. Xexport char *pager;
  53. X
  54. Xexport char *log_file;            /* = lib/Log */
  55. Xexport char *log_entry_filter = NULL;
  56. X
  57. Xexport char *temp_file;
  58. X
  59. X#ifndef TMP_DIRECTORY
  60. X#define TMP_DIRECTORY "/usr/tmp"
  61. X#endif
  62. Xexport char *tmp_directory = TMP_DIRECTORY;
  63. X
  64. Xexport char version_id[32];
  65. X
  66. Xexport unsigned short user_id, group_id;
  67. Xexport int process_id;
  68. Xexport int who_am_i;
  69. Xexport int dont_write_console = 0;
  70. X
  71. X#ifdef HAVE_MULTIGROUP
  72. X#ifndef NGROUPS
  73. X#include <sys/param.h>
  74. X#endif
  75. X#ifndef GIDSET_TYPE
  76. X#define GIDSET_TYPE int
  77. X#endif
  78. Xstatic int ngroups;
  79. Xstatic GIDSET_TYPE gidset[NGROUPS];
  80. X
  81. Xstatic in_grplist(gid)
  82. XGIDSET_TYPE gid;
  83. X{
  84. X    int n;
  85. X
  86. X    for (n = 0; n < ngroups; ++n)
  87. X    if (gidset[n] == gid) return 1;
  88. X
  89. X    return 0;
  90. X}
  91. X
  92. X#define group_access(gpid)    in_grplist((GIDSET_TYPE)(gpid))
  93. X#else
  94. X#define group_access(gid)    ((gid) == group_id)
  95. X#endif
  96. X
  97. X/* signal handler interface */
  98. X
  99. Xexport int s_hangup        = 0;    /* hangup signal */
  100. Xexport int s_keyboard        = 0;    /* keyboard interrupt */
  101. Xexport int s_pipe        = 0;    /* broken pipe */
  102. Xexport int s_redraw        = 0;    /* redraw signal (if job control) */
  103. X
  104. Xsig_type catch_hangup(n)
  105. X{
  106. X    signal(n, SIG_IGN);
  107. X
  108. X    s_hangup++;
  109. X}
  110. X
  111. Xstatic sig_type catch_keyboard(n)
  112. X{
  113. X    s_keyboard++;
  114. X
  115. X#ifdef RESET_SIGNAL_WHEN_CAUGHT
  116. X    signal(n, catch_keyboard);
  117. X#endif
  118. X}
  119. X
  120. Xstatic sig_type catch_pipe(n)
  121. X{
  122. X    s_pipe++;
  123. X
  124. X#ifdef RESET_SIGNAL_WHEN_CAUGHT
  125. X    signal(n, catch_pipe);
  126. X#endif
  127. X}
  128. X
  129. X#ifdef HAVE_JOBCONTROL
  130. Xstatic sig_type catch_suspend(n)
  131. X{
  132. X    s_redraw++;
  133. X
  134. X#ifdef RESET_SIGNAL_WHEN_CAUGHT
  135. X    signal(n, catch_suspend);
  136. X#endif
  137. X
  138. X    suspend_nn();
  139. X}
  140. X#endif
  141. X
  142. X
  143. Xinit_global()
  144. X{
  145. X    unsigned short getuid(), getgid();
  146. X    int getpid();
  147. X    int suspend_nn();
  148. X
  149. X    if (who_am_i != I_AM_NN) {
  150. X    signal(SIGINT,  SIG_IGN);
  151. X    signal(SIGQUIT, SIG_IGN);
  152. X    }
  153. X    signal(SIGTERM, catch_hangup);
  154. X    signal(SIGHUP,  catch_hangup);
  155. X    signal(SIGPIPE, catch_pipe);
  156. X    signal(SIGALRM, SIG_IGN);
  157. X
  158. X#ifdef SIGPWR
  159. X    signal(SIGPWR, catch_hangup);
  160. X#endif
  161. X
  162. X    sprintf(version_id, "%s.%d #%d", RELEASE, PATCHLEVEL,
  163. X#include "update.h"
  164. X        );
  165. X
  166. X    user_id = getuid();
  167. X
  168. X#ifdef HAVE_MULTIGROUP
  169. X    ngroups = getgroups(NGROUPS, gidset);    /* Get users's group set */
  170. X    group_id = gidset[0];    /* not used, but just in case... */
  171. X#else
  172. X    group_id = getgid();
  173. X#endif
  174. X
  175. X    process_id = getpid();
  176. X
  177. X#ifdef NEWS_DIRECTORY
  178. X    news_directory = NEWS_DIRECTORY;
  179. X#else
  180. X    news_directory = "/usr/spool/news";
  181. X#endif
  182. X
  183. X#ifdef DB_DIRECTORY
  184. X    db_directory = DB_DIRECTORY;
  185. X#else
  186. X    db_directory = mk_file_name(news_directory, ".nn");
  187. X#endif
  188. X
  189. X#ifdef ACCOUNTING
  190. X    if (who_am_i == I_AM_ACCT)
  191. X    return 0;
  192. X#endif
  193. X
  194. X#ifdef DB_DATA_DIRECTORY
  195. X    db_data_directory = DB_DATA_DIRECTORY;
  196. X#else
  197. X#ifdef DB_DIRECTORY
  198. X    db_data_directory = mk_file_name(db_directory, "DATA");
  199. X#else
  200. X    db_data_directory = NULL;
  201. X#endif
  202. X#endif
  203. X
  204. X#ifdef NEWS_LIB_DIRECTORY
  205. X    news_lib_directory = NEWS_LIB_DIRECTORY;
  206. X#else
  207. X    news_lib_directory = "/usr/lib/news";
  208. X#endif
  209. X
  210. X    /* this may later be changed by nntp_check */
  211. X    news_active = mk_file_name(news_lib_directory, "active");
  212. X
  213. X#ifdef CLIENT_DIRECTORY
  214. X    lib_directory = CLIENT_DIRECTORY;
  215. X#else
  216. X    lib_directory = LIB_DIRECTORY;
  217. X#endif
  218. X
  219. X#ifdef MASTER_DIRECTORY
  220. X    master_directory = MASTER_DIRECTORY;
  221. X#else
  222. X    master_directory = lib_directory;
  223. X#endif
  224. X
  225. X#ifdef HELP_DIRECTORY
  226. X    help_directory = HELP_DIRECTORY;
  227. X#else
  228. X    help_directory = mk_file_name(lib_directory, "help");
  229. X#endif
  230. X
  231. X#ifdef LOG_FILE
  232. X    log_file = LOG_FILE;
  233. X#else
  234. X    log_file = mk_file_name(lib_directory, "Log");
  235. X#endif
  236. X
  237. X    if (who_am_i == I_AM_MASTER || who_am_i == I_AM_SPEW)
  238. X    return 0;
  239. X
  240. X    signal(SIGINT,  catch_keyboard);
  241. X    signal(SIGQUIT, catch_keyboard);
  242. X#ifdef HAVE_JOBCONTROL
  243. X    signal(SIGTSTP, catch_suspend);
  244. X#endif
  245. X
  246. X    if ((home_directory = getenv("HOME")) == NULL)
  247. X    user_error("No HOME environment variable");
  248. X
  249. X    if ((pager = getenv("PAGER")) == NULL)
  250. X    pager = DEFAULT_PAGER;
  251. X
  252. X    nn_directory = mk_file_name(home_directory, ".nn");
  253. X
  254. X    if (who_am_i != I_AM_ADMIN && !file_exist(nn_directory, "drwx")) {
  255. X    if (who_am_i != I_AM_NN) return -1;
  256. X    if (mkdir(nn_directory, 0755) < 0)
  257. X        user_error("Cannot create %s directory", nn_directory);
  258. X    return 1;
  259. X    }
  260. X
  261. X    return 0;
  262. X}
  263. X
  264. Xnew_temp_file()
  265. X{
  266. X    static char buf[FILENAME];
  267. X    static char *temp_dir = NULL;
  268. X
  269. X    if (temp_dir == NULL)
  270. X    if ((temp_dir = getenv("TMPDIR")) == NULL)
  271. X        temp_dir = tmp_directory; /* just to make test above false */
  272. X    else
  273. X        tmp_directory = temp_dir;
  274. X
  275. X    sprintf(buf, "%s/nn.XXXXXX", tmp_directory);
  276. X    mktemp(buf);
  277. X    temp_file = buf;
  278. X}
  279. X
  280. X
  281. XFILE *open_file(name, mode)
  282. Xchar *name;
  283. Xint mode;
  284. X{
  285. X    FILE *f;
  286. X    int fd;
  287. X    extern int errno;
  288. X
  289. X    if ((mode & DONT_CREATE) && !file_exist(name, (char *)NULL))
  290. X    return NULL;
  291. X
  292. X    switch (mode & 0x0f) {
  293. X
  294. X     case OPEN_READ:
  295. X
  296. X    f = fopen(name, "r");
  297. X    break;
  298. X
  299. X     case OPEN_UPDATE:
  300. X
  301. X/*    f = fopen(name, "r+");     -- not reliable on many systems (sigh) */
  302. X
  303. X    if ((fd = open(name, O_WRONLY)) >= 0) {
  304. X        if ((f = fdopen(fd, "w")) != NULL) return f;
  305. X        close(fd);
  306. X    }
  307. X
  308. X    /* fall thru */
  309. X
  310. X     case OPEN_CREATE:
  311. X
  312. X    f = fopen(name, "w");
  313. X    break;
  314. X
  315. X     case OPEN_APPEND:
  316. X
  317. X    f = fopen(name, "a");
  318. X    break;
  319. X
  320. X     case OPEN_CREATE_RW:
  321. X
  322. X    f = fopen(name, "w+");    /* not safe on all systems -- beware */
  323. X    break;
  324. X
  325. X     default:
  326. X
  327. X    sys_error("Illegal mode: open_file(%s, 0x%x)", name, mode);
  328. X    }
  329. X
  330. X    if (f) {
  331. X    if (mode & OPEN_UNLINK) unlink(name);
  332. X    return f;
  333. X    }
  334. X
  335. X    if ((mode & MUST_EXIST) == 0) return NULL;
  336. X
  337. X    sys_error("Cannot open file %s, mode=0x%x, errno=%d", name, mode, errno);
  338. X
  339. X    return NULL;
  340. X}
  341. X
  342. X
  343. X
  344. X
  345. X/*
  346. X *     relative -- concat directory name and file name
  347. X */
  348. X
  349. Xchar *relative(dir, name)
  350. Xchar *dir, *name;
  351. X{
  352. X    static char concat_path[FILENAME];
  353. X
  354. X    sprintf(concat_path, "%s/%s", dir, name);
  355. X    return concat_path;
  356. X}
  357. X
  358. X
  359. Xchar *mk_file_name(dir, name)
  360. Xchar *dir, *name;
  361. X{
  362. X    char *buf;
  363. X
  364. X    buf = newstr(strlen(dir) + strlen(name) + 2);
  365. X    sprintf(buf, "%s/%s", dir, name);
  366. X
  367. X    return buf;
  368. X}
  369. X
  370. X
  371. Xchar *home_relative(dir)
  372. Xchar *dir;
  373. X{
  374. X    if (dir) {
  375. X    if (*dir == '/')
  376. X        return copy_str(dir);
  377. X    else {
  378. X        if (*dir == '~' && *++dir == '/') dir++;
  379. X        return mk_file_name(home_directory, dir);
  380. X    }
  381. X    }
  382. X    return NULL;
  383. X}
  384. X
  385. X
  386. Xchar *copy_str(str)
  387. Xchar *str;
  388. X{
  389. X    char *new;
  390. X
  391. X    new = newstr(strlen(str) + 1);
  392. X    if (new) strcpy(new, str);
  393. X
  394. X    return new;
  395. X}
  396. X
  397. Xtime_t m_time(f)
  398. XFILE *f;
  399. X{
  400. X    struct stat st;
  401. X
  402. X    if (fstat(fileno(f), &st) < 0) return 0;
  403. X    return st.st_mtime;
  404. X}
  405. X
  406. X
  407. Xtime_t file_exist(name, mode)
  408. Xchar *name;
  409. Xchar *mode;
  410. X{
  411. X    struct stat statb;
  412. X    extern int errno;
  413. X
  414. X    if (stat(name, &statb)) return 0;
  415. X
  416. X    if (mode == NULL) return statb.st_mtime;
  417. X
  418. X    while (*mode) {
  419. X    switch (*mode++) {
  420. X    case 'd':
  421. X        if ((statb.st_mode & S_IFMT) == S_IFDIR) continue;
  422. X        errno = ENOTDIR;
  423. X        return 0;
  424. X    case 'f':
  425. X        if ((statb.st_mode & S_IFMT) == S_IFREG) continue;
  426. X        if ((statb.st_mode & S_IFMT) == 0000000) continue;
  427. X        if ((statb.st_mode & S_IFMT) == S_IFDIR) {
  428. X        errno = EISDIR;
  429. X        return 0;
  430. X        }
  431. X        break;
  432. X    case 'r':
  433. X        if ((statb.st_mode & 0400) && statb.st_uid == user_id) continue;
  434. X        if ((statb.st_mode & 0040) && group_access(statb.st_gid)) continue;
  435. X            if ((statb.st_mode & 0004)) continue;
  436. X        break;
  437. X    case 'w':
  438. X        if ((statb.st_mode & 0200) && statb.st_uid == user_id) continue;
  439. X        if ((statb.st_mode & 0020) && group_access(statb.st_gid)) continue;
  440. X            if ((statb.st_mode & 0002)) continue;
  441. X        break;
  442. X    case 'x':
  443. X        if ((statb.st_mode & 0100) && statb.st_uid == user_id) continue;
  444. X        if ((statb.st_mode & 0010) && group_access(statb.st_gid)) continue;
  445. X            if ((statb.st_mode & 0001)) continue;
  446. X        break;
  447. X    }
  448. X    errno = EACCES;
  449. X    return 0;
  450. X    }
  451. X
  452. X    /* all modes are ok */
  453. X    return statb.st_mtime;
  454. X}
  455. X
  456. X
  457. X#ifdef HAVE_SYSLOG
  458. X#include <syslog.h>
  459. X#endif /* HAVE_SYSLOG */
  460. X
  461. X
  462. Xstatic enter_log(type, va_tail)
  463. Xchar type;
  464. Xva_tdcl
  465. X{
  466. X    FILE *log;
  467. X    char *msg, buf[512];
  468. X
  469. X    if (log_entry_filter != NULL)
  470. X    for (msg = log_entry_filter; *msg; msg++)
  471. X        if (*msg == type) return 1;
  472. X
  473. X    msg  = va_arg1(char *);
  474. X    vsprintf(buf, msg, va_args2toN);
  475. X
  476. X    /* cannot use relative: one of the args may be generated by it */
  477. X
  478. X    log = open_file(log_file, OPEN_APPEND);
  479. X    if (log == NULL) return 0;
  480. X
  481. X    fprintf(log, "%c: %s (%s): %s\n", type,
  482. X        date_time((time_t)0), user_name(), buf);
  483. X
  484. X    fclose(log);
  485. X    return 1;
  486. X}
  487. X
  488. X/*VARARGS*/
  489. Xsys_error(va_alist)
  490. Xva_dcl
  491. X{
  492. X    char buf[512];
  493. X    char *fmt;
  494. X    FILE *f;
  495. X    use_vararg;
  496. X
  497. X    start_vararg;
  498. X    enter_log('E', va_args1toN);
  499. X    end_vararg;
  500. X
  501. X    start_vararg;
  502. X    fmt = va_arg1(char *);
  503. X    vsprintf(buf, fmt, va_args2toN);
  504. X    end_vararg;
  505. X
  506. X    if (who_am_i == I_AM_MASTER) {
  507. X    if (dont_write_console) nn_exit(7);
  508. X#ifndef HAVE_SYSLOG
  509. X    f = open_file("/dev/console", OPEN_CREATE);
  510. X    if (f == NULL) nn_exit(8);
  511. X    fprintf(f, "\n\rNNMASTER FATAL ERROR\n\r%s\n\n\r", buf);
  512. X    fclose(f);
  513. X#else /* HAVE_SYSLOG */
  514. X    openlog("nnmaster", LOG_CONS, LOG_DAEMON);
  515. X    syslog(LOG_ALERT, "%s", buf);
  516. X    closelog();
  517. X#endif /* HAVE_SYSLOG */
  518. X    nn_exit(7);
  519. X    }
  520. X    user_error("%s", buf);
  521. X}
  522. X
  523. X/*VARARGS*/
  524. Xlog_entry(va_alist)
  525. Xva_dcl
  526. X{
  527. X    int type, rval;
  528. X    use_vararg;
  529. X
  530. X    start_vararg;
  531. X    type = va_arg1(int);
  532. X    rval = enter_log(type, va_args2toN);
  533. X    end_vararg;
  534. X
  535. X    return rval;
  536. X}
  537. X
  538. Xchar *user_name()
  539. X{
  540. X    static char *user = NULL;
  541. X    struct passwd *pw, *getpwuid();
  542. X
  543. X    if (who_am_i == I_AM_MASTER) return "M";
  544. X    if (who_am_i == I_AM_EXPIRE) return "X";
  545. X
  546. X    if (user == NULL) {
  547. X    pw = getpwuid((int)user_id);
  548. X    if (pw == NULL) user = "?";
  549. X    user = copy_str(pw->pw_name);
  550. X    }
  551. X
  552. X    return user;
  553. X}
  554. X
  555. Xtime_t cur_time()
  556. X{
  557. X    time_t t;
  558. X
  559. X    time(&t);
  560. X    return t;
  561. X}
  562. X
  563. Xchar *date_time(t)
  564. Xtime_t t;
  565. X{
  566. X    char *str;
  567. X
  568. X    if (t == (time_t)0) t = cur_time();
  569. X    str = ctime(&t);
  570. X
  571. X    str[16] = 0;
  572. X    return str+4;
  573. X}
  574. X
  575. Xchar *plural(n)
  576. Xlong n;
  577. X{
  578. X    return n != 1 ? "s" : "";
  579. X}
  580. X
  581. X/*
  582. X *    memory management
  583. X */
  584. X
  585. X/* #define MEM_DEBUG        /* trace memory usage */
  586. X
  587. Xstatic mem_error(t, bytes)
  588. Xint t;
  589. Xint32 bytes;
  590. X{
  591. X    char buf[200];
  592. X
  593. X    if (t == 1) {
  594. X    sprintf(buf, "Alloc failed: unsigned too short to represent %ld bytes",
  595. X        (long)bytes);
  596. X    } else {
  597. X    sprintf(buf, "Out of memory - cannot allocate %ld bytes",
  598. X        (long)bytes);
  599. X    }
  600. X
  601. X    sys_error(buf);
  602. X}
  603. X
  604. Xchar *mem_obj(size, nelt)
  605. Xunsigned size;
  606. Xint32 nelt;
  607. X{
  608. X    unsigned n;
  609. X    char *obj, *calloc();
  610. X
  611. X    n = nelt;
  612. X    if (n != nelt) mem_error(1, nelt);
  613. X
  614. X    obj = calloc(n, size);
  615. X#ifdef MEM_DEBUG
  616. X    printf("CALLOC(%u,%u) => %lx\n", n, size, (long)obj);
  617. X#endif
  618. X    if (obj == NULL) mem_error(2, (int32)(size * nelt));
  619. X    return obj;
  620. X}
  621. X
  622. Xchar *mem_str(nelt)
  623. Xint32 nelt;
  624. X{
  625. X    unsigned n;
  626. X    char *obj, *malloc();
  627. X
  628. X    n = nelt;
  629. X    if (n != nelt) mem_error(1, nelt);
  630. X
  631. X    obj = malloc(n);
  632. X#ifdef MEM_DEBUG
  633. X    printf("MALLOC(%u) => %lx\n", n, (long)obj);
  634. X#endif
  635. X    if (obj == NULL) mem_error(2, nelt);
  636. X    return obj;
  637. X}
  638. X
  639. Xchar *mem_resize(obj, size, nelt)
  640. Xchar *obj;
  641. Xunsigned size;
  642. Xint32 nelt;
  643. X{
  644. X    unsigned n;
  645. X    char *realloc(), *obj1;
  646. X
  647. X    if (obj == NULL)
  648. X    return mem_obj(size, nelt);
  649. X
  650. X    nelt *= size;
  651. X
  652. X    n = nelt;
  653. X    if (n != nelt) mem_error(1, nelt);
  654. X
  655. X    obj1 = realloc(obj, n);
  656. X#ifdef MEM_DEBUG
  657. X    printf("REALLOC(%lx, %u) => %lx\n", (long)obj, n, (long)obj1);
  658. X#endif
  659. X    if (obj1 == NULL) mem_error(2, (int32)size);
  660. X    return obj1;
  661. X}
  662. X
  663. Xmem_free(obj)
  664. Xchar *obj;
  665. X{
  666. X#ifdef MEM_DEBUG
  667. X    printf("FREE(%lx)\n", (long)obj);
  668. X#endif
  669. X    if (obj != NULL) free(obj);
  670. X}
  671. X
  672. X#ifndef HAVE_MKDIR
  673. X
  674. Xmkdir(path, mode)
  675. Xchar *path;
  676. Xint mode;
  677. X{
  678. X    char command[FILENAME*2 + 20];
  679. X
  680. X    sprintf(command, "{ mkdir %s && chmod %o %s ; } > /dev/null 2>&1",
  681. X        path, mode, path);
  682. X    return system(command) != 0 ? -1 : 0;
  683. X}
  684. X#endif
  685. END_OF_FILE
  686.   if test 12323 -ne `wc -c <'global.c'`; then
  687.     echo shar: \"'global.c'\" unpacked with wrong size!
  688.   fi
  689.   # end of 'global.c'
  690. fi
  691. if test -f 'man/nn.1.D' -a "${1}" != "-c" ; then 
  692.   echo shar: Will not clobber existing file \"'man/nn.1.D'\"
  693. else
  694.   echo shar: Extracting \"'man/nn.1.D'\" \(39579 characters\)
  695.   sed "s/^X//" >'man/nn.1.D' <<'END_OF_FILE'
  696. X.\" BEGINPART D
  697. X.SH CUSTOMIZED ARTICLE HEADER PRESENTATION
  698. XNormally, \fInn\fP will just print a (high-lighted) single line header
  699. Xcontaining the author, subject, and date (optional) of the article
  700. Xwhen it is read.
  701. X.LP
  702. XBy setting the
  703. X.B header-lines
  704. Xvariable as described below, it is possible to get a more informative
  705. Xmulti line header with optional high-lighting and underlining.
  706. X.LP
  707. XThe
  708. X.B header-lines
  709. Xvariable is set to a list of header line identifiers, and the
  710. Xcustomized headers will then contain exactly these header lines
  711. X\fIin the specified order\fP.
  712. X.LP
  713. XThe following header line identifiers are recognized in the
  714. X.B header-lines
  715. Xvariable:
  716. X.LP
  717. X.in +8n
  718. X.ta 5m
  719. X.\"ta 4 9
  720. X.br
  721. X\fBA\fP    Approved:
  722. X.br
  723. X\fBB\fP    Distribution:
  724. X.br
  725. X\fBD\fP    Date:
  726. X.br
  727. X\fBd\fP    Date-Received:
  728. X.br
  729. X\fBF\fP    From:
  730. X.br
  731. X\fBI\fP    Message-Id:
  732. X.br
  733. X\fBK\fP    Keywords:
  734. X.br
  735. X\fBL\fP    Lines:
  736. X.br
  737. X\fBN\fP    Newsgroups:
  738. X.br
  739. X\fBn\fP    Newsgroups:   (but only if cross posted)
  740. X.br
  741. X\fBO\fP    Organization:
  742. X.br
  743. X\fBP\fP    Path:
  744. X.br
  745. X\fBR\fP    Reply-To:
  746. X.br
  747. X\fBS\fP    Subject:
  748. X.br
  749. X\fBW\fP    Followup-To:
  750. X.br
  751. X\fBX\fP    References:
  752. X.br
  753. X\fBx\fP    Back-References:
  754. X.br
  755. X\fBY\fP    Summary:
  756. X.in -8n
  757. X.DT
  758. X.LP
  759. XPreceding the identifier with an equal sign "=" or an underscore "_"
  760. Xwill cause the header field contents to be high-lighted or underlined.
  761. X.LP
  762. XIncluding an asterisk "*" in the list will produce the standard one
  763. Xline header at that point.
  764. X.LP
  765. XExample:  The following setting of the
  766. X.B header-lines
  767. Xvariable will show the author (underlined), organization, posting
  768. Xdate, and subject (high-lighted) when articles are read:
  769. X.sp 0.5v
  770. X    set header-lines _FOD=S
  771. X.SH COMMAND LINE OPTIONS
  772. XSome of the command line options have already been described, but
  773. Xbelow we provide a complete list of the effect of each option by
  774. Xshowing the equivalent
  775. X.BR set ,
  776. X.BR unset ,
  777. Xor
  778. X.B toggle
  779. Xcommand.
  780. X.LP
  781. XNotice that the init files are read \fIbefore\fP the options are
  782. Xparsed (unless you use the \-\fBI\fP option).  Therefore, the options
  783. Xwhich are related to boolean variables set in the init file will
  784. Xtoggle the value set there, rather than the default value.
  785. XConsequently, the meaning of the options are also user-defined.
  786. X.LP
  787. XThe explanations below describe the effect related to the default
  788. Xsetting of the variables, with the `reverse' effect in square
  789. Xbrackets.
  790. X.TP
  791. X\-\fBa\fP\fIN\fP    {\fBset limit\fP \fIN\fP}
  792. X.I Limit
  793. Xthe maximum number of articles presented in each group to
  794. X.I N.
  795. XThis is useful to get up-to-date quickly if you have not
  796. Xread news for a longer period.
  797. X.TP
  798. X\-\fBa0\fP
  799. XMark
  800. X.I all
  801. Xunread articles as read.  See the full explanation at the beginning of
  802. Xthis manual.
  803. X.TP
  804. X\-\fBB\fP    {\fBtoggle backup\fP}
  805. XDo not [do] backup the rc file.
  806. X.TP
  807. X\-\fBd\fP    {\fBtoggle split\fP}
  808. XDo not [do] split digests into separate articles.
  809. X.TP
  810. X\-\fBf\fP    {\fBtoggle fsort\fP}
  811. XDo not [do] sort folders according to the subject (present the
  812. Xarticles in a folder in the sequence in which they were saved).
  813. X.TP
  814. X\-\fBg\fP
  815. XPrompt for the name of a news group or folder to be entered
  816. X.TP
  817. X\-\fBi\fP    {\fBtoggle case-fold-search\fP}
  818. XNormally searches with \-\fBn\fP and \-\fBs\fP are case indenpendent.
  819. XUsing this option, the case becomes significant.
  820. X.TP
  821. X\-\fBI\fP
  822. XDo not read the init file.  This must be the first option!!
  823. X.TP
  824. X\-\fBI\fP\fIfile-list\fP
  825. XSpecifies an alternate list of init files to be loaded instead of the
  826. Xstandard global and private init files.  The list is a comma-separated
  827. Xlist of file names.  Names which does not contain a `/' are looked for
  828. Xin the ~/.nn directory.  An empty element in the list is interpreted
  829. Xas the global init file.  The list of init files must
  830. X\fInot\fP be separated from the \fB\-I\fP option by blanks, and it
  831. Xmust be the first option.  Example:  The default behaviour corresponds
  832. Xto using -I,init (first the global file, then the file ~/.nn/init).
  833. X.TP
  834. X\-\fBk\fP    {\fBtoggle kill\fP}
  835. XDo not [do] perform automatic kill and selection of articles.
  836. X.TP
  837. X\-\fBl\fP\fIN\fP    {\fBset stop\fP \fIN\fP}
  838. XStop after printing the first \fIN\fP lines of each article.
  839. XThis is useful on slow terminals.
  840. X.TP
  841. X\-\fBL\fP[\fIf\fP]    {\fBset layout\fP \fIf\fP}
  842. XSelect alternative menu layout
  843. X.IR f
  844. X(0 to 4).
  845. XIf
  846. X.I f
  847. Xis omitted, menu layout 3 is selected.
  848. X.TP
  849. X\-\fBm\fP    {\fIno corresponding variable\fP}
  850. XMerge all articles into one `meta group' instead of showing
  851. Xthem one group at a time.  When -m is used, no articles will be marked
  852. Xas read.
  853. X.TP
  854. X\-\fBn\fP\fIWORD\fP
  855. XCollect only articles which contain the string \fIWORD\fP in the
  856. Xsender's name (case is ignored).  If \fIWORD\fP
  857. Xstarts with a slash `/', the rest of the argument is used as a
  858. X\fIregular expression\fP instead of a fixed string.
  859. X.TP
  860. X\-\fBN\fP    {\fIno corresponding variable\fP}
  861. XDisable updating of the rc file.  This includes not recording that
  862. Xgroups have been read or unsubscribed to (although \fInn\fP will think
  863. Xso until you quit).
  864. X.TP
  865. X\-\fBq\fP    {\fBtoggle sort\fP}
  866. XDo not [do] sort the articles (q means quick, but it isn't
  867. Xany quicker in practice!)
  868. X.TP
  869. X\-\fBQ\fP    {\fBtoggle silent\fP}
  870. XQuiet mode - don't [do] print the logo or "No News" messages.
  871. X.TP
  872. X\-\fBr\fP    {\fBtoggle repeat-group-query\fP}
  873. XMake \-\fBg\fP repeat query for a group to enter.
  874. X.TP
  875. X\-\fBs\fP\fIWORD\fP
  876. XCollect only articles which contain the string
  877. X.I WORD
  878. Xin their subject (case is ignored).  If
  879. X.I WORD
  880. Xstarts with a slash `/', the rest of the argument is used as a
  881. X\fIregular expression\fP instead of a fixed string.
  882. X.TP
  883. X\-\fBS\fP    {\fBtoggle repeat\fP}
  884. XDo not [do] eliminate duplicated subject lines on menus.
  885. X.TP
  886. X\-\fBT\fP    {\fBtoggle time\fP}
  887. XDo not [do] show the current time in the prompt line.
  888. X.TP
  889. X\-\fBw\fP[\fIN\fP]    {\fBset window\fP \fIN\fP}
  890. XReserve \fIN\fP lines of the menu screen for a preview window.  If
  891. X\fIN\fP is omitted, the preview window is set to 5 lines.
  892. X.TP
  893. X\-\fBW\fP    {\fBtoggle confirm-messages\fP}
  894. X[Don't] Wait for confirmation on all messages.
  895. X.TP
  896. X\-\fBx\fP[\fIN\fP]    {\fBset old N\fP}
  897. XPresent (or scan) all (or the last \fIN\fP) unread as well as
  898. Xread articles.  This will
  899. X.I never
  900. Xmark unread articles as read.
  901. X.TP
  902. X\-\fBX\fP    {\fIno corresponding variable\fP}
  903. XRead/scan unsubscribed groups also.  Most useful when looking for
  904. Xa specific subject in all groups, e.g.
  905. X.br
  906. X   nn -mxX -sSubject all
  907. X.br
  908. X.SH MACRO DEFINITIONS
  909. XPractically any combination of commands and key strokes can be defined
  910. Xas a macro which can be bound to a single key in menu and/or reading mode.
  911. X.LP
  912. XThe macro definition must specify a sequence of commands and key
  913. Xstrokes as if they were typed directly from the keyboard.  For
  914. Xexample, a string specifying a file name must follow a save command.
  915. XThis manual does not give a complete specification of all the input
  916. Xrequired by the various commands; it is recommended to execute the
  917. Xdesired command sequence from the keyboard prior to defining the macro
  918. Xto get the exact requirements of each command.
  919. X.LP
  920. XAlthough it is possible to define temporary macros interactively using the
  921. X.B :define
  922. Xcommand, macro definitions are normally placed in the
  923. X.I init
  924. Xfile.  Macros are numbered from 0 to 100, i.e. it is possible to define
  925. Xa total of 101 different macros (inplicit macros defined with the
  926. X\fBmap\fP command uses internal numbers from 101 to 200).
  927. X.LP
  928. XTo define macro number \fIM\fP, the following construction is used
  929. X(the line breaks are mandatory):
  930. X.nf
  931. X    \fBdefine\fP \fIM\fP
  932. X        \fIbody\fP
  933. X    \fBend\fP
  934. X.fi
  935. X.LP
  936. XThe \fIbody\fP consists of a sequence of \fItokens\fP separated by
  937. Xwhite space (blanks or newlines).  However, certain \fItokens\fP
  938. Xcontinue to the end of the current line.
  939. X.LP
  940. XThe following \fItokens\fP may occur in the macro \fIbody\fP:
  941. X.TP
  942. X.I Comments
  943. XEmpty lines and text following a # character (preceded by white space)
  944. Xis ignored.
  945. X.TP
  946. X.I Command Names
  947. XAny command name listed in the key mapping section can be included in
  948. Xa macro causing that command to be invoked when the macro is executed.
  949. X.TP
  950. X.I Extended Commands
  951. XAll the extended commands which can be executed through the
  952. X.B command
  953. Xcommand (normally bound to the : key) can also be executed in a macro.
  954. XAn extended command starts with a colon (:) and continues to the
  955. Xend of the current line.  Example:
  956. X.br
  957. X    :show groups total
  958. X.TP
  959. X.I Key Strokes
  960. XA key stroke (which is normally mapped into a command depending on the
  961. Xcurrent mode) is specified as a key name enclosed in single quotes.
  962. XExamples (A-key, left arrow key, RETURN key):
  963. X.br
  964. X    'A'  'left'  '^M'
  965. X.TP
  966. X.I Shell Commands
  967. XExternal commands can be invoked as part of a macro execution.  There
  968. Xare two forms of shell command invokations available depending on
  969. Xwhether a command \fImay\fP produce output or require user input, or
  970. Xit is \fIguaranteed\fP to complete without input or output to the
  971. Xterminal.  The difference is that in the latter case, \fInn\fP does
  972. Xnot prepare the terminal to be used by another program.  When the
  973. Xcommand completes, the screen is \fInot\fP redrawn
  974. Xautomatically; you should use the \fBredraw\fP command to do that.
  975. XThe tho forms are:
  976. X.sp 0.5v
  977. X    :!echo this command uses the terminal
  978. X.br
  979. X    :!!echo this command does not > /tmp/file
  980. X.TP
  981. X.I Strings
  982. XInput to commands prompting for a string, e.g. a file name, can be
  983. Xspecified in a macro as a double quoted string.  Example (save without
  984. Xprompting for a file name):
  985. X.br
  986. X    \fBsave-short\fP "+$G"
  987. X.TP
  988. X.I Conditionals
  989. XConditionals may occur anywhere in a macro; a conditional is evaluated
  990. Xwhen the macro is executed, and if the condition is false \fIthe rest
  991. Xof the current line is ignored\fP.  The following conditionals are available:
  992. X.nf
  993. X    \fB?menu\fP    True in menu mode
  994. X    \fB?show\fP    True in reading mode
  995. X    \fB?folder\fP    True when looking at a folder
  996. X    \fB?group\fP    True when looking at a news group
  997. X    \fB?yes\fP    Query user, true if answer is yes
  998. X    \fB?no\fP    Query user, true if answer is no
  999. X.fi
  1000. XExample (stop macro execution if user rejects to continue):
  1001. X.br
  1002. X    \fBprompt\fP "continue? " \fB?no break\fP
  1003. X.sp 0.5v
  1004. XIn addition to these conditionals, it is possible to test the current
  1005. Xvalue of boolean and integer variables using the following form:
  1006. X.br
  1007. X    \fB?\fP\fIvariable\fP\fB=\fP\fIvalue\fP
  1008. X.br
  1009. XThis conditional will be true (1) if the variable is an integer variable
  1010. Xwhose current value is the one specified, or (2) if the variable is a
  1011. Xboolean variable which is either \fBon\fP or \fBoff\fP.  Examples:
  1012. X.nf
  1013. X    ?layout=3 :set layout 1
  1014. X    ?monitor=on  break
  1015. X    ?sort=off :sort age
  1016. X.fi
  1017. X.TP
  1018. X.B break
  1019. XTerminate macro execution completely.  This includes nested macros.
  1020. XExample (stop if looking at a folder):
  1021. X.br
  1022. X    \fB?folder\fP \fBbreak\fP
  1023. X.TP
  1024. X.B return
  1025. XTerminate execution of current macro.  If the current macro is called
  1026. Xfrom another macro, execution of that macro continues immediately.
  1027. X.TP
  1028. X.B input
  1029. XQuery the user for a key stroke or a string, for example a file name.
  1030. XExample (prompt the user for a file name in the usual way):
  1031. X.br
  1032. X    \fBsave-short\fP \fBinput\fP
  1033. X.TP
  1034. X.B yes
  1035. XConfirm unconditionally \fIif\fP a command requires confirmation.  It
  1036. Xis ignored if the command does not require confirmation.  Example
  1037. X(confirm creation of new files):
  1038. X.br
  1039. X    \fBsave-short\fP "+$G" \fByes\fP
  1040. X.TP
  1041. X.B no
  1042. XTerminate execution of current macro \fIif\fP a command requires
  1043. Xconfirmation; otherwise ignore it.  If neither \fByes\fP nor \fBno\fP
  1044. Xis specified when a command requires confirmation, the user must
  1045. Xanswer the question as usual \- if the user confirms the action
  1046. Xexecution continues normally; otherwise the execution of the current
  1047. Xmacro is terminated.  Example (do not create new files):
  1048. X.br
  1049. X    \fBsave-short\fP "+$L/misc" \fBno\fP
  1050. X.TP
  1051. X\fBprompt\fP \fIstring\fP
  1052. XPrint the \fIstring\fP in the prompt line (highlighted).  The string
  1053. Xmust be enclosed in double quotes.  Example:
  1054. X.br
  1055. X    \fBprompt\fP "Enter recipient name"
  1056. X.br
  1057. XWhen the macro terminates, the original prompt shown on entry to the
  1058. Xmacro will automatically be redrawn.  If this is not desireable (e.g.
  1059. Xif the macro goes from selection to reading mode), the redrawing of
  1060. Xthe prompt can be disabled by using a \fBprompt\fP command with an
  1061. Xempty \fIstring\fP ("").  Example:
  1062. X.nf
  1063. X    \fBprompt\fP "Enter reading mode?" # old prompt is saved
  1064. X    ?no return # and old prompt is restored
  1065. X    read-skip       # changes the prompt
  1066. X    \fBprompt\fP "" # so forget old prompt
  1067. X.TP
  1068. X\fBecho\fP \fIstring\fP
  1069. XDisplay the \fIstring\fP in the prompt line for a short period.  Example:
  1070. X.br
  1071. X    ?show \fBecho\fP "Cannot be used in reading mode" break
  1072. X.TP
  1073. X\fBputs\fP \fIstring-to-end-of-line\fP
  1074. XThe rest of the line is output directly to the terminal without
  1075. Xinterpretation.
  1076. X.TP
  1077. X\fBmacro\fP \fIM\fP
  1078. XInvoke macro number \fIM\fP.  The maximum macro nesting level is five
  1079. X(also catches macro loops).
  1080. X.LP
  1081. XI use the following macro to quickly save all the selected files in a
  1082. Xfile whose name is entered as usual.  It also works in reading mode
  1083. X(saving just the current article).
  1084. X.nf
  1085. X    \fBdefine\fP 1
  1086. X        :unset save-report
  1087. X        save-short input yes
  1088. X        ?menu '+'
  1089. X        :set save-report
  1090. X    \fBend\fP
  1091. X.fi
  1092. X.SH KEY MAPPINGS
  1093. XThe descriptions of the keys and commands provided in this manual
  1094. Xreflects the default key mappings in \fInn\fP.  However, you can
  1095. Xeasily change these mappings to match your personal demands, and it is
  1096. Xalso possible to remap keys depending on the terminal in use.
  1097. XPermanent remapping of keys must be done through the
  1098. X.I init
  1099. Xfile, while temporary changes (for the duration of the current
  1100. Xinvocation of \fInn\fP) can be made with the
  1101. X.B :map
  1102. Xcommand.
  1103. X.LP
  1104. XThe binding and mapping of keys are controlled by four tables:
  1105. X.TP
  1106. X.B The multikey definition table
  1107. XThis table is used for mapping multicharacter key sequences into
  1108. Xsingle characters.  By default the table contains the mappings for the
  1109. Xfour cursor keys, and there is room for 10 user-defined multikeys.
  1110. XThe fourteen multikeys are named:
  1111. X.BR up ,
  1112. X.BR down ,
  1113. X.BR right ,
  1114. X.BR left
  1115. X(the four arrow keys), and
  1116. X.BR #0
  1117. Xthrough
  1118. X.BR #9
  1119. Xfor the user-defined keys.
  1120. X.sp 0.5v
  1121. XMultikey #\fIi\fP is defined using the following command:
  1122. X.sp 0.5v
  1123. X    \fBmap #\fP\fIi\fP \fIkey-sequence\fP
  1124. X.sp 0.5v
  1125. Xwhere the
  1126. X.I sequence
  1127. Xis a list of 7-bit character names (see below) separated by spaces.
  1128. XFor example, if the HOME key sends the sequence ESC [ H, you can
  1129. Xdefine multikey #0 to be the home key using the command:
  1130. X.sp 0.5v
  1131. X    map #0 ^[ [ H
  1132. X.TP
  1133. X.B The input key mapping table
  1134. XAll characters that are read from the keyboard will be mapped through
  1135. Xthe input mapping table.  Consequently, you can globally remap one key
  1136. Xto produce any other key value.  By default all keys are mapped into
  1137. Xthemselves.
  1138. X.sp 0.5v
  1139. XAn entry in the input key mapping table to map \fIinput-key\fP into
  1140. X\fInew-key\fP is made with the command
  1141. X.sp 0.5v
  1142. X    \fBmap key\fP \fIinput-key\fP \fInew-key\fP
  1143. X.sp 0.5v
  1144. XFor example, to make your ESC key function as
  1145. X.B interrupt
  1146. Xyou can use the command
  1147. X.sp 0.5v
  1148. X    map key ^[ ^G
  1149. X.TP
  1150. X.B The selection mode key binding table
  1151. XThis table defines for each key which command should be invoked when
  1152. Xthat key is pressed in selection mode, i.e. when the article menu is
  1153. Xshown.  The command to bind a
  1154. X.I key
  1155. Xto a
  1156. X.I command
  1157. Xin selection mode is:
  1158. X.sp 0.5v
  1159. X    \fBmap menu\fP \fIkey command\fP
  1160. X.sp 0.5v
  1161. XFor example, to have the HOME key defined as multikey #0 above bound
  1162. Xto the
  1163. X.B select
  1164. Xcommand, the following command is used:
  1165. X.sp 0.5v
  1166. X    map menu #0 select
  1167. X.sp 0.5v
  1168. XTo remap a key to select a specific article on the menu (which the `a'
  1169. Xthrough `z' keys do by default), the \fIcommand\fP must be specified
  1170. Xas `\fBarticle\fP \fIN\fP' where \fIN\fP is the entry number on the
  1171. Xmenu counted from zero (i.e. a=0, b=1, ..., z=25, 0=26, ..., 9=35).
  1172. XFor example, to map `J' to select article `j', the following
  1173. Xcommand is used:
  1174. X.sp 0.5v
  1175. X    map menu J article 9
  1176. X.TP
  1177. X.B The reading mode key binding table
  1178. XThis table defines for each key which command should be invoked when
  1179. Xthat key is pressed in reading mode, i.e. when the article text is
  1180. Xshown.  The command to bind a
  1181. X.I key
  1182. Xto a
  1183. X.I command
  1184. Xin reading mode is:
  1185. X.sp 0.5v
  1186. X    \fBmap show\fP \fIkey command\fP
  1187. X.TP
  1188. X.B Mapping keys in both modes
  1189. XUsing the pseudo-keymap `both', it is possible to map a key to a
  1190. Xcommand in both selection and reading mode at once.  For example, to
  1191. Xmap the home key to macro number 5 in both modes, the following
  1192. Xcommand can be used:
  1193. X.sp 0.5v
  1194. X    map both #0 macro 5
  1195. X.TP
  1196. X.B Aliasing
  1197. XA key can also be mapped directly to the command currently bound to
  1198. Xanother key.  Later remapping of the other key will not change the
  1199. Xmapping of the `aliased' key.  This is done using the following command:
  1200. X.sp 0.5v
  1201. X    map \fIkeymap new-key\fP \fBas\fP \fIold-key\fP
  1202. X.TP
  1203. X.B Binding macros to keys
  1204. XA previously defined macro can be bound to a key using the command:
  1205. X.sp 0.5v
  1206. X    map \fIkeymap key\fP \fBmacro\fP \fImacro-number\fP
  1207. X.TP
  1208. X.B Implicit macro definitions
  1209. XAn implicit macro can also be defined directly in connection with the
  1210. X\fBmap\fP command:
  1211. X.sp 0.5v
  1212. X    map \fIkeymap key\fP \fB(\fP
  1213. X.br
  1214. X    \fIbody\fP...
  1215. X.br
  1216. X    \fB)\fP
  1217. X.LP
  1218. XKeys and character names are specified using the following notation:
  1219. X.TP
  1220. X.I C
  1221. XA single printable character represents the key or character itself.
  1222. X.TP
  1223. X\fB^\fP\fIC\fP
  1224. XThis notation represents a control key or character.
  1225. XDEL is written as \fB^?\fP
  1226. X.TP
  1227. X\fI125\fP, \fI0175\fP, \fI0x7D\fP
  1228. XCharacters and keys can be specified by their ordinal value in
  1229. Xdecimal, octal, and hexadecimal notation.
  1230. X.TP
  1231. X\fBup\fP, \fBdown\fP, \fBright\fP, \fBleft\fP
  1232. XThese names represent the cursor keys.
  1233. X.TP
  1234. X\fB#0\fP  through  \fB#9\fP
  1235. XThese symbols represent the ten user-defined multikeys.
  1236. X.LP
  1237. XTo show the current contents of the four tables, the following
  1238. Xversions of the \fB:map\fP command are available:
  1239. X.TP
  1240. X.B :map
  1241. XShow the current mode's key bindings.
  1242. X.TP
  1243. X.B :map menu
  1244. XShow the selection mode key bindings.
  1245. X.TP
  1246. X.B :map show
  1247. XShow the reading mode key bindings.
  1248. X.TP
  1249. X.B :map #
  1250. XShow the multikey definition table.
  1251. X.TP
  1252. X.B :map key
  1253. XShow the input key mapping table.
  1254. X.SH STANDARD KEY BINDINGS
  1255. XBelow is a list of all the commands that can be bound to keys, either
  1256. Xin selection mode, in reading mode, or both.  For each command the
  1257. Xdefault command key bindings in both modes are shown.
  1258. XIf the key is not bound in one of the modes, but it can be bound, the
  1259. Xcorresponding part will just be empty.  If the command cannot be bound
  1260. Xin one of the modes, that mode will contain the word \fBnix\fP.
  1261. X.LP
  1262. X.in +8n
  1263. X.ta \w'continue-no-mark'u+5m +\w'Selection_mode'u+3m
  1264. X.\"ta 4 26 42
  1265. X.br
  1266. X\fIFunction    Selection mode    Reading mode
  1267. X.br
  1268. X\fBadvance-article\fP    \fBnix\fP     a
  1269. X.br
  1270. X\fBadvance-group\fP    A     A
  1271. X.br
  1272. X\fBarticle\fP \fIN\fP    a-z0-9     \fBnix\fP
  1273. X.br
  1274. X\fBback-article\fP    \fBnix\fP     b
  1275. X.br
  1276. X\fBback-group\fP    B     B
  1277. X.br
  1278. X\fBcancel\fP    C     C
  1279. X.br
  1280. X\fBcommand\fP    :      :
  1281. X.br
  1282. X\fBcompress\fP    \fBnix\fP     c
  1283. X.br
  1284. X\fBcontinue\fP    \fBspace\fP     \fBspace\fP
  1285. X.br
  1286. X\fBcontinue-no-mark\fP    \fBreturn\fP     \fBnix\fP
  1287. X.br
  1288. X\fBdecode\fP
  1289. X.br
  1290. X\fBfind\fP    =     /
  1291. X.br
  1292. X\fBfind-next\fP    \fBnix\fP     .
  1293. X.br
  1294. X\fBfollow\fP    F     fF
  1295. X.br
  1296. X\fBfull-digest\fP    \fBnix\fP     H
  1297. X.br
  1298. X\fBgoto-group\fP    G     G
  1299. X.br
  1300. X\fBgoto-menu\fP    \fBnix\fP     = Z
  1301. X.br
  1302. X\fBhelp\fP    ?     ?
  1303. X.br
  1304. X\fBjunk-articles\fP    J     \fBnix\fP
  1305. X.br
  1306. X\fBkill-select\fP    K     K
  1307. X.br
  1308. X\fBlayout\fP    "     \fBnix\fP
  1309. X.br
  1310. X\fBleave-article\fP    \fBnix\fP     l
  1311. X.br
  1312. X\fBleave-next\fP    L     L
  1313. X.br
  1314. X\fBline+1\fP    ,  \fBdown\fP     \fBreturn\fP
  1315. X.br
  1316. X\fBline-1\fP    /     \fBnix\fP
  1317. X.br
  1318. X\fBline=@\fP    \fBnix\fP     g
  1319. X.br
  1320. X\fBmacro\fP \fIM\fP
  1321. X.br
  1322. X\fBmail\fP    M     m M
  1323. X.br
  1324. X\fBmessage\fP    ^P     ^P
  1325. X.br
  1326. X\fBnext-article\fP    \fBnix\fP     n
  1327. X.br
  1328. X\fBnext-group\fP    N     N
  1329. X.br
  1330. X\fBnext-subject\fP    \fBnix\fP     k
  1331. X.br
  1332. X\fBnil\fP
  1333. X.br
  1334. X\fBoverview\fP    Y     Y
  1335. X.br
  1336. X\fBpage+1\fP    >     \fBnix\fP
  1337. X.br
  1338. X\fBpage+1/2\fP    \fBnix\fP     d
  1339. X.br
  1340. X\fBpage-1\fP    <     \fBdelete  backspace\fP
  1341. X.br
  1342. X\fBpage-1/2\fP    \fBnix\fP     u
  1343. X.br
  1344. X\fBpage=0\fP    \fBnix\fP     h
  1345. X.br
  1346. X\fBpage=1\fP    ^     ^
  1347. X.br
  1348. X\fBpage=$\fP    $     $
  1349. X.br
  1350. X\fBpatch\fP
  1351. X.br
  1352. X\fBpost\fP
  1353. X.br
  1354. X\fBpreview\fP    %     %
  1355. X.br
  1356. X\fBprevious\fP    P     p
  1357. X.br
  1358. X\fBprint\fP        P
  1359. X.br
  1360. X\fBquit\fP    Q     Q
  1361. X.br
  1362. X\fBread-return\fP    Z     \fBnix\fP
  1363. X.br
  1364. X\fBread-skip\fP    X     X
  1365. X.br
  1366. X\fBredraw\fP    ^L ^R     ^L ^R
  1367. X.br
  1368. X\fBreply\fP    R     r R
  1369. X.br
  1370. X\fBrot13\fP    \fBnix\fP     D
  1371. X.br
  1372. X\fBsave-body\fP    W     w W
  1373. X.br
  1374. X\fBsave-full\fP    S     s S
  1375. X.br
  1376. X\fBsave-short\fP    O     o O
  1377. X.br
  1378. X\fBselect\fP    .     \fBnix\fP
  1379. X.br
  1380. X\fBselect-auto\fP    +     \fBnix\fP
  1381. X.br
  1382. X\fBselect-invert\fP    @     \fBnix\fP
  1383. X.br
  1384. X\fBselect-range\fP    -     \fBnix\fP
  1385. X.br
  1386. X\fBselect-subject\fP    *     *
  1387. X.br
  1388. X\fBshell\fP    !     !
  1389. X.br
  1390. X\fBskip-lines\fP    \fBnix\fP     \fBtab\fP
  1391. X.br
  1392. X\fBunselect-all\fP    ~     \fBnix\fP
  1393. X.br
  1394. X\fBunshar\fP
  1395. X.br
  1396. X\fBunsub\fP    U     U
  1397. X.br
  1398. X\fBversion\fP    V     V
  1399. X.in -8n
  1400. X.DT
  1401. X.LP
  1402. XSee the descriptions of the default bindings for a description of the
  1403. Xcommands.  The pseudo command
  1404. X.B nil
  1405. Xis used to
  1406. X.I unbind
  1407. Xa key.
  1408. X.SH THE INIT FILES
  1409. XThe
  1410. X.I init
  1411. Xfiles are used to customize \fInn\fP's behaviour to your personal taste.
  1412. X\fINn\fP uses two init files \- a system-wide init file located in the
  1413. Xlibrary directory, and a private init file located in the user's
  1414. X\&\fI.nn\fP directory.  The private init file is read after the global
  1415. Xinit file to allow the user to change the default setup.
  1416. X.LP
  1417. XThe init file may contain the following types of commands (and data):
  1418. X.TP
  1419. X.B Comments
  1420. XEmpty lines and lines with a # character as the first non-blank
  1421. Xcharacter are ignored.
  1422. X.TP
  1423. X.B Variable settings
  1424. XYou can
  1425. X.B set
  1426. X(or
  1427. X.BR unset )
  1428. Xall the variables described earlier to change
  1429. Xnn's behaviour permanently.  The
  1430. X.B set
  1431. Xand
  1432. X.B unset
  1433. Xcommands you can use in the init file have exactly the same format as
  1434. Xthe
  1435. X.B :set
  1436. Xand
  1437. X.B :unset
  1438. Xcommands described earlier (except that the : prefix is omitted.)
  1439. X.TP
  1440. X.B Key mappings
  1441. XYou can use all the versions of the
  1442. X.B map
  1443. Xcommand in the init file.
  1444. X.TP
  1445. X.B Macro Definitions
  1446. XYou can define sequences of commands and key strokes using the
  1447. X\fBdefine\fP...\fBend\fP construction,
  1448. Xwhich can then be
  1449. Xbound to single keys with the
  1450. X.B map
  1451. Xcommand.
  1452. X.TP
  1453. X.B Load terminal specific files
  1454. XYou can load a terminal specific file using the
  1455. X.sp 0.5v
  1456. X    \fBload\fP \fIfile\fP
  1457. X.sp 0.5v
  1458. XThe character
  1459. X.B @
  1460. Xin the
  1461. X.I file
  1462. Xwill be replaced by the terminal type defined in the TERM environment
  1463. Xvariable.  \fInn\fP silently ingores the
  1464. X.B load
  1465. Xcommand if the file does not exist (so you don't have to have a
  1466. Xspecific init file for terminals which does not require remapping).
  1467. XIf the file is not specified by an absolute pathname, it must reside
  1468. Xin your ~/.nn directory.  Examples:
  1469. X.nf
  1470. X    # load local customizations
  1471. X    load /usr/lib/nninit
  1472. X    # load personal terminal specific customizations
  1473. X    load init.@
  1474. X.fi
  1475. X.TP
  1476. X.B Change working directory of nn
  1477. XYou can use the
  1478. X.B cd
  1479. Xcommand to change the working directory whenever you enter \fInn\fP.
  1480. XExample:
  1481. X.nf
  1482. X    # Use folder directory as working directory inside \fInn\fP
  1483. X    cd ~/News
  1484. X.fi
  1485. X.TP
  1486. X.B Command groups
  1487. XThe init file can contain groups of commands which are executed under
  1488. Xspecial conditions.  The command groups are described in the section
  1489. Xon command groups below.
  1490. X.TP
  1491. X.B One or more save-files sections
  1492. XA \fBsave-files\fP section is used to assign default save files to
  1493. Xspecific groups:
  1494. X.sp 0.5v
  1495. X.nf
  1496. X    \fBsave-files\fP
  1497. X      \fIgroup-name (pattern)\fP \fIfile-name\fP
  1498. X      ...
  1499. X    \fBend\fP
  1500. X.fi
  1501. X.sp 0.5v
  1502. XThe group name (patterns) and save file names are specified in the
  1503. Xsame way as in the presentation sequence (see below).  Example:
  1504. X.br
  1505. X.nf
  1506. X    \fBsave-files\fP
  1507. X      news*  +news/$L
  1508. X      comp.sources*  /u/src/$L/
  1509. X    \fBend\fP
  1510. X.fi
  1511. X.TP
  1512. X.B The news group presentation sequence
  1513. XThe
  1514. X.I last
  1515. Xpart of the init file may specify the sequence in which you want the
  1516. Xnews groups to be presented.  This part starts with the command
  1517. X.B sequence
  1518. Xand continues to the end of the init file.
  1519. X.LP
  1520. XBoth init files may contain a presentation sequence.  In this case,
  1521. Xthe global sequence is \fIappended\fP to the private sequence.
  1522. X.SH COMMAND GROUPS
  1523. XCommand groups may only occur in the init file, and they provide a way
  1524. Xto have series of commands executed at certain points during news reading.
  1525. X.LP
  1526. XIn release 6.4, these possibilities are still rather rudimentary, and
  1527. Xa mixture of normal init file syntax and macro syntax is used
  1528. Xdepending on whether the command group is only executed on start-up or
  1529. Xseveral times during the \fInn\fP session.
  1530. X.LP
  1531. XA command group begins with the word \fBon\fP and
  1532. Xends with the word \fBend\fP.  The \fBon\fP symbol must followed by
  1533. Xone of the following identifiers denoting when the group is executed:
  1534. X.sp 0.5v
  1535. X.nf
  1536. X    \fBon\fP ...
  1537. X    commands
  1538. X    \fBend\fP
  1539. X.fi
  1540. X.sp 0.5v
  1541. XThe following command groups may be defined:
  1542. X.TP
  1543. X\fBon slow\fP
  1544. X.br
  1545. XThe commands (init file syntax) in the group are executed only if the
  1546. Xcurrent terminal output speed is less than or equal to the baud rate
  1547. Xset in the \fBslow-speed\fP variable.  This can be used to optimize
  1548. Xthe user-interface for slow terminals by setting suitable variables:
  1549. X.sp 0.5v
  1550. X.nf
  1551. X    \fBon slow\fP
  1552. X        set confirm-entry
  1553. X        set slow-mode
  1554. X        set delay-redraw
  1555. X        unset visible-bell
  1556. X        set compress
  1557. X        unset header-lines
  1558. X        set stop 5
  1559. X        set window 10
  1560. X    \fBend\fP
  1561. X.fi
  1562. X.TP
  1563. X\fBon fast\fP
  1564. X.br
  1565. XSame as \fBon slow\fP except that the commands are only executed when
  1566. Xthe terminal is running at a speed above the \fBslow-speed\fP value.
  1567. X.TP
  1568. X\fBon term\fP \fIterm-type\fP...
  1569. X.br
  1570. XThe commands are executed if one of the \fIterm-type\fP names is
  1571. Xidentical to value of the TERM environment variable.
  1572. X.TP
  1573. X\fBon host\fP \fIhost-name\fP...
  1574. X.br
  1575. XThe commands are executed if the local host's name occur in the
  1576. X\fIhost-name\fP list.
  1577. X.TP
  1578. X\fBon entry\fP [ \fIgroup list\fP ]
  1579. X.br
  1580. XThese commands (macro format!) are executed every time \fInn\fP enters a
  1581. Xnews group.  If a group list is not specified, the commands are
  1582. Xassociated with all groups which don't have its own entry macro
  1583. Xspecified in the group sequence.  Otherwise, the entry macro will be
  1584. Xassociated with the groups in the list.  The group list is specified
  1585. Xusing the meta-notations described in the presentation sequence section.
  1586. X.sp 0.5v
  1587. XThe `:set', `:unset', and `:local' commands at the beginning of the
  1588. Xcommand group are executed \fIbefore\fP \fInn\fP collects the articles
  1589. Xin the group, so it is possible to set variables like
  1590. X\fBcross-post\fP.  The other commands, and :set/:unset commands that
  1591. Xfollows a command of another type will be executed immediately
  1592. X\fIafter\fP the first menu page is presented.
  1593. X.sp 0.5v
  1594. X.nf
  1595. X    \fBon entry\fP comp.sources* alt.sources
  1596. X        :local cross-post on
  1597. X    \fBend\fP
  1598. X.fi
  1599. X.SH GROUP PRESENTATION SEQUENCE
  1600. XNews groups are normally presented in the sequence defined in the
  1601. Xsystem-wide
  1602. X.B init
  1603. Xfile in \fInn\fP's library directory.
  1604. X.LP
  1605. XYou can personalize the presentation sequence
  1606. Xby specifying an alternative sequence in the private
  1607. X.I init
  1608. Xfile.
  1609. XThe sequence in the private init file is used
  1610. X.I before
  1611. Xthe global presentation sequence, and need only
  1612. Xdescribe the deviations from the default presentation sequence.
  1613. X.LP
  1614. XThe presentation sequence must start with the word
  1615. X.br
  1616. X    \fBsequence\fP
  1617. X.br
  1618. Xfollowed by a list of the news group names in the order you want them
  1619. Xto be presented.
  1620. XThe group names must be separated by white space.
  1621. XThe sequence list must be the \fIlast\fP part of the
  1622. Xinit file (the parsing of commands from the init file stops when the
  1623. Xword \fBsequence\fP is encountered).
  1624. X.LP
  1625. XYou may use a full group name like "comp.unix.questions", or just the
  1626. Xname of a main group or subgroup, e.g. "comp" or "comp.unix".
  1627. XHowever, if "comp" precedes "comp.unix.questions" in the list, this
  1628. Xsubgroup will be placed in the normal alphabetic sequence during the
  1629. Xcollection of all the "comp" groups.
  1630. X.LP
  1631. XGroups which are not explicitly mentioned in any of the sequence files
  1632. Xwill be placed after the mentioned groups, unless `!!' is used and it
  1633. Xhas not been disabled (as described below).
  1634. X.LP
  1635. XEach group name may be followed by a file or folder name (must start
  1636. Xwith either of `/' `~' or `+') which will specify the default save file
  1637. Xfor that group (and its subgroups).  A single `+' following the group
  1638. Xname is an abbreviation for the last save file name used.
  1639. X.LP
  1640. XWhen an article is saved, the default save name will be used as the
  1641. Xinitial contents of the file name prompt for further editing.  It
  1642. Xtherefore does not need to be be a complete file name (unless you use
  1643. Xthe quick save mode).
  1644. X.LP
  1645. XEach group name may also be associated
  1646. Xwith a so-called \fBentry action\fP.  This is basically an (unnamed)
  1647. Xmacro which is invoked on entry to the group (following the same rules
  1648. Xas the `on entry' command group related to :set and :unset commands).
  1649. X.LP
  1650. XThe entry action begins with a left parenthesis `\fB(\fP' and ends
  1651. Xwith a right parenthesis `\fB)\fP' on an otherwise empty line:
  1652. X.sp 0.5v
  1653. X.nf
  1654. X    comp.sources. +src/$L/ (
  1655. X        :set cross-post
  1656. X    )
  1657. X.fi
  1658. X.sp 0.5v
  1659. XThe last entry action can be repeated by specifying an empty set of
  1660. Xparenthesis, e.g.
  1661. X.sp 0.5v
  1662. X    comp.unix. +unix ()
  1663. X.sp 0.5v
  1664. XThe entry action of a preceding group in the sequence can be
  1665. Xassociated with the current group(s) by specifying the name of the
  1666. Xgroup in the parentheses instead of the commands, e.g.
  1667. X.sp 0.5v
  1668. X    comp.unix. +unix (comp.sources.unix)
  1669. X.sp 0.5v
  1670. XA macro can also be associated with the entry action by specifying its
  1671. Xnumber in the same way as the group name above, e.g.
  1672. X.sp 0.5v
  1673. X    rec.music. +music (30)
  1674. X.sp 0.5v
  1675. XNotice that it is the
  1676. X\fIcurrent\fP definition of the macro which is associated with the
  1677. Xgroup, so if the macro is later redefined with the `:define' command,
  1678. Xit will not have any effect on the entry action.
  1679. X.LP
  1680. XGroup names can be specified using the following notations:
  1681. X.TP
  1682. Xgroup.name
  1683. XAppend the group (if it exists) to the presentation sequence list.  If
  1684. X\fBalso-subgroups\fP is set (default), all subscribed subgroups of the
  1685. Xgroup will be included as well (if there are any).  Examples: "comp",
  1686. X"comp.unix", "comp.unix.questions".  If the group does not exits (e.g.
  1687. X"comp"), the subgroups will be included even when \fBalso-subgroups\fP
  1688. Xis not set, i.e. "comp" is equivalent to "comp.".
  1689. X.TP
  1690. Xgroup.name.
  1691. XAppend the subgroups of the specified group to the presentation
  1692. Xsequence.  The group itself (if it exists) is not included.
  1693. XExamples: "comp.", "comp.unix.".
  1694. X.TP
  1695. X.group.name
  1696. XAppend the groups whose name ends with the specified name to the
  1697. Xsequence.  Example: ".test".
  1698. X.TP
  1699. Xgroup.name*
  1700. XAppend the group and its subgroups to the presentation sequence list
  1701. X(even when \fBalso-subgroups\fP is not set).  Example: "comp.unix*".
  1702. X.LP
  1703. XThe following meta notation can be used in a sequence file.  The
  1704. Xgroup.name can be specified using any of the forms described above:
  1705. X.TP
  1706. X\&! groups
  1707. XCompletely ignore the group or groups specified
  1708. Xunless they are already in the presentation sequence (i.e. has been
  1709. Xexplicitly mentioned earlier in the sequence).
  1710. X.TP
  1711. X\&!:\fIcode\fP groups
  1712. XIgnore a selection of groups based on the given \fIcode\fP letter (see
  1713. Xbelow), unless they are already included in the sequence.  Notice that
  1714. Xthese forms \fIonly\fP excludes groups from the
  1715. Xpresentation sequence, i.e. they \fIdo not\fP include the remaining
  1716. Xgroups at this point; that must be done explicitly elsewhere.
  1717. X.TP
  1718. X\&!:U groups
  1719. XIgnore unsubscribed groups, i.e. if they are neither new, nor present
  1720. Xand subscribed in \&.newsrc.
  1721. XThis is useful to ignore a whole hierarchy except for a
  1722. Xfew groups which are explicitly mentioned in \&.newsrc and still see
  1723. Xnew groups as they are created.
  1724. X.TP
  1725. X\&!:X groups
  1726. XIgnore unsubscribed \fIand\fP new groups, i.e. if they are not
  1727. Xcurrently present and subscribed in \&.newsrc.
  1728. XThis is useful to ignore a whole hierarchy except for a
  1729. Xfew groups which are explicitly mentioned in \&.newsrc.  New groups in
  1730. Xthe hierarchy are ignored unless `NEW' occurs earlier in the sequence.
  1731. X.TP
  1732. X\&!:O groups
  1733. XIgnore old groups, i.e. \fIunless\fP they are new.  This is useful to
  1734. Xignore a whole hierarchy but still see new groups which are created in
  1735. Xthe hierarchy (it might become interesting some day).  Individual
  1736. Xgroups can still be included in the sequence if they are specified
  1737. Xbefore the `!:O' entry.
  1738. X.TP
  1739. X\&!:N groups
  1740. XIgnore new groups in the hierarchy.
  1741. X.TP
  1742. X\&!!
  1743. XStop building the presentation sequence.  This eliminates all groups
  1744. Xthat are not already in the presentation sequence.
  1745. X.TP
  1746. X\fBNEW\fP
  1747. XThis is a pseudo group name which matches all \fInew\fP groups; you
  1748. Xcould place this symbol early in your presentation sequence to see new
  1749. Xgroups `out of sequence' (to attract your attention to them).
  1750. X.TP
  1751. X\fBRC\fP
  1752. XThis is a pseudo group name which matches all groups occurring in the
  1753. X.newsrc file.  It will cause the groups in .newsrc to be appended to
  1754. Xthe presentation sequence in the sequence in which they are listed in
  1755. X.newsrc.
  1756. X.TP
  1757. X\fBRC:\fP\fInumber\fP
  1758. XSimilar to the \fBRC\fP entry, but limited to the first \fInumber\fP
  1759. Xlines of the .newsrc file.  Example: RC:10 (use 10 lines of .newsrc).
  1760. X.TP
  1761. X\fBRC:\fP\fIstring\fP
  1762. XSimilar to the \fBRC\fP entry, but limited to the lines upto (and
  1763. Xincluding) the first line (i.e. group) starting with the given
  1764. X\fIstring\fP.  For example:  RC:alt.sources
  1765. X.TP
  1766. X\&< group.name
  1767. XPlace the group (and its subgroups) at the beginning of the
  1768. Xpresentation sequence.  Notice that each `<' entry will place the
  1769. Xgroup(s) at the beginning of the current sequence, i.e. < A < B < C
  1770. Xwill generate the sequence C B A.
  1771. X.TP
  1772. X\&> group.name
  1773. XPlace the group (and its subgroups) after all other groups that are
  1774. Xand will be entered into the presentation sequence.
  1775. X.TP
  1776. X\&@
  1777. XDisable the `!!' command.  This can be included in the personal
  1778. Xpresentation sequence if the global
  1779. X.B sequence
  1780. Xfile contains a !! entry (see example 1 below).
  1781. X.TP
  1782. X\&% .... %
  1783. XStarts and ends a region of the sequence where it is possible to
  1784. Xinclude groups which has been eliminated earlier.  This may be useful
  1785. Xto alter the sequence of some groups, e.g. to place comp.sources.bugs
  1786. Xafter all other source groups, the following sequence can be used:
  1787. X.sp 0.5v
  1788. X! comp.sources.bugs comp.sources* % comp.sources.bugs %
  1789. X.LP
  1790. X.sp 0.5v
  1791. X.B Example 1:
  1792. XIn a company where ordinary users only should read the local
  1793. Xnews groups, and ignore the rest (including new news groups which are
  1794. Xotherwise always subscribed to initially), can use the following
  1795. Xglobal presentation sequence:
  1796. X.sp 0.5v
  1797. X.nf
  1798. X    general
  1799. X    follow
  1800. X    ! local.test
  1801. X    local
  1802. X    !!
  1803. X.fi
  1804. X.sp 0.5v
  1805. XThe "expert" users in the company must put the
  1806. X.B @
  1807. Xcommand somewhere
  1808. Xin their private sequence to avoid losing news groups which they have
  1809. Xnot explicitly mentioned in their init file.
  1810. X.sp
  1811. X.B Example 2:
  1812. XThis is the global sequence for systems with
  1813. Xheavy news addicts who setup their own sequences anyway.
  1814. X.nf
  1815. X.sp 0.5v
  1816. X    # all must read the general news first
  1817. X    < general
  1818. X.sp 0.5v
  1819. X    # test is test, and junk is junk,
  1820. X    # so it is placed at the very end
  1821. X    > test
  1822. X    > .test
  1823. X    > junk
  1824. X.sp 0.5v
  1825. X    # this is the standard sequence which everybody may
  1826. X    # change to their own liking
  1827. X    local    # our local groups
  1828. X    dk    # the Danish groups
  1829. X    eunet.general # to present it before eunet.followup
  1830. X    eunet    # the other European groups
  1831. X    comp    # the serious groups
  1832. X    news    # news on news
  1833. X    sci    # other serious groups
  1834. X    rec    # not really that important (don't quote me)
  1835. X    misc    # well, it must be somewhere
  1836. X.sp 0.5v
  1837. X    # the groups that are not listed above goes here
  1838. X.sp 0.5v
  1839. X.fi
  1840. XNotice the use of comments in the sequence where they are allowed at
  1841. Xthe end of non-empty lines as well.
  1842. X.sp
  1843. X.B Example 3:
  1844. XMy own presentation sequence (in the init file) simply
  1845. Xlists my favourite groups and the corresponding default save files:
  1846. X.nf
  1847. X.sp 0.5v
  1848. X   \fBsequence\fP
  1849. X    !:U alt*  # ignore unsubscribed alt groups
  1850. X    news.software.nn +nn
  1851. X    comp.sys.ti* +ti/$L
  1852. X    NEW  # show new groups here
  1853. X    news*
  1854. X    rec.music.synth +synth/
  1855. X    comp.emacs*,gnu.emacs +emacs/misc
  1856. X    comp.risks +risks
  1857. X    eunet.sources +src/unix/
  1858. X    comp.sources* +src/$L/
  1859. X.sp 0.5v
  1860. X.fi
  1861. XThe presentation sequence is not used when \fInn\fP is called with one or
  1862. Xmore news group names on the command line; it is thus possible to read
  1863. Xignored groups (on explicit request) wihtout changing the init file.
  1864. X(Of course, you can also use the
  1865. X.B G
  1866. Xcommand to read ignored groups).
  1867. X.SH MERGING NEWS GROUPS
  1868. XThe third example above contains the following line:
  1869. X.sp 0.5v
  1870. X    comp.emacs*,gnu.emacs +emacs/misc
  1871. X.sp 0.5v
  1872. XThis is the syntax used to \fImerge\fP groups.  When two or more
  1873. Xgroups are merged, all new articles in these groups are presented
  1874. Xtogether as if they were one group.  To merge groups, their names must
  1875. Xbe listed together in the sequence, and only separated by a single
  1876. Xcomma.  To merge the groups resulting from a single group pattern
  1877. X(e.g. comp.emacs*), the group pattern must be followed by a comma and
  1878. Xa blank (e.g. comp.emacs*, ...).
  1879. X.LP
  1880. XMerged groups are presented as the first group in the "list", and the
  1881. Xword "MERGED" will be shown after the group name.  The \fBY\fP
  1882. X{\fBoverview\fP} command will still show merged groups as individual
  1883. Xgroups, but they will be annotated with the symbol `&' on the first of
  1884. Xthe groups, and a `+' on the rest of the groups.
  1885. X.LP
  1886. XIn the current version, the concept of the \fIcurrent group\fP in
  1887. Xconnection with merged groups is a bit fuzzy.  This should only be
  1888. Xnoticeable with the \fBG\fP command, which will take the most recently
  1889. Xused group among the merged groups as the current group.  So things
  1890. Xlike \fBG = ...\fP may not always work as expected.
  1891. X.SH ENVIRONMENT
  1892. XThe following environment variables are used by \fInn\fP:
  1893. X.LP
  1894. X.BR EDITOR .
  1895. XThe editor invoked when editing replies, follow-ups, and composing
  1896. Xmail.  \fInn\fP knows about the following editors:
  1897. X\fIvi\fP, \fIded\fP, \fIGNU emacs\fP, and \fImicro-emacs\fP,
  1898. Xand will try to position the cursor on the first line following the
  1899. Xheader, i.e. after the blank line which must not be deleted!  If an
  1900. Xarticle has been included, the cursor is placed on the first line of
  1901. Xthe included text (to allow you to delete sections easily).
  1902. X.LP
  1903. X.BR LOGNAME .
  1904. XThis is taken as the login name of the current user.  It is used by
  1905. X\fInn\fP to return failed mail.  If it is not defined, \fInn\fP will
  1906. Xuse the value of USER, or if that is not defined either, \fInn\fP will
  1907. Xuse the call `who am i' to get this information.  If all attempts
  1908. Xfail, the failed mail is dropped in the bit bucket.
  1909. X.LP
  1910. X.BR PAGER .
  1911. XThis is used as the initial value of the \fBpager\fP variable.
  1912. X.LP
  1913. X.BR SHELL .
  1914. XThis is the shell which is spawned if the system cannot suspend
  1915. X\fInn\fP, and it will be used to execute the shell escapes.
  1916. X.LP
  1917. X.BR TERM .
  1918. XThe terminal type.
  1919. X.SH FILES
  1920. X.DT
  1921. X.nr tW \w'~/.nn/KILL.COMP'
  1922. X.nr tX \w'/usr/lib/nntp-server'
  1923. X.if \n(tWu>\n(tXu .nr tX \n(tWu
  1924. X.ta \n(tWu+3m
  1925. X.\"ta 0 22
  1926. X~/.newsrc    The record of read articles.
  1927. X.br
  1928. X~/.nn/select    The record of selected and seen articles.
  1929. X.br
  1930. X~/.nn/init    Personal configuration and presentation sequence.
  1931. X.br
  1932. X~/.nn/kill    The automatic kills and selections.
  1933. X.br
  1934. X~/.nn/KILL.COMP    The compiled kill file.
  1935. X.br
  1936. X~/.nn/LAST    The time stamp of the last news group we have seen.
  1937. X.br
  1938. X~/.nn/.param    Parameter file for the aux script
  1939. X.br
  1940. X$lib/init    System-wide setup and presentation sequence.
  1941. X.br
  1942. X$lib/aux    The response edit and send script.
  1943. X.br
  1944. X$lib/routes    Mapping rules for mail addresses (on non-domain systems).
  1945. X.br
  1946. X$db/*    The news data base.
  1947. X.br
  1948. X/etc/termcap    Terminal data base [BSD].
  1949. X.br
  1950. X/usr/lib/terminfo/*    Terminal data base [SysV].
  1951. X.br
  1952. X/usr/lib/nntp-server    Name of remote nntp server.
  1953. X.sp 0.5v
  1954. X.DT
  1955. XThe name $lib and $db are the directories used for the auxiliary files
  1956. Xand the news data base respectively.  Their name and location is
  1957. Xdefined at compile time.  Common choices are /usr/local/lib/nn or
  1958. X/usr/lib/news/nn for $lib and /usr/spool/nn or /usr/spool/news/.nn for
  1959. X$db.
  1960. X.SH SEE ALSO
  1961. XOther netnews documentation.
  1962. X.br
  1963. Xnncheck(1), nngoback(1), nngrep(1), nntidy(1)
  1964. X.br
  1965. Xnnadmin(1M), nnquery(1M), nnusage(1M), nnmaster(8)
  1966. X.SH AUTHOR
  1967. XKim F. Storm, Texas Instruments A/S, Denmark
  1968. X.br
  1969. XE-mail: storm@texas.dk  (but see the addresses below)
  1970. X.LP
  1971. XThe NNTP support was designed and implemented by Ren\o'\(aae' Seindal,
  1972. XInstitute of Datalogy, University of Copenhagen, Denmark.
  1973. X.LP
  1974. XBugs and fixes, suggestions, ideas, critique, etc. can be sent to
  1975. Xthe following address:
  1976. X.br
  1977. X    nn-bugs@dkuug.dk
  1978. X.LP
  1979. XThe news.software.nn group is used for discussion on all subjects
  1980. Xrelated to the nn news reader.  This includes, but is not limited to,
  1981. Xquestions, answers, ideas, hints, information from the development
  1982. Xgroup, patches, etc.
  1983. X.\" ENDPART D
  1984. END_OF_FILE
  1985.   if test 39579 -ne `wc -c <'man/nn.1.D'`; then
  1986.     echo shar: \"'man/nn.1.D'\" unpacked with wrong size!
  1987.   fi
  1988.   # end of 'man/nn.1.D'
  1989. fi
  1990. echo shar: End of archive 4 \(of 22\).
  1991. cp /dev/null ark4isdone
  1992. MISSING=""
  1993. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ; do
  1994.     if test ! -f ark${I}isdone ; then
  1995.     MISSING="${MISSING} ${I}"
  1996.     fi
  1997. done
  1998. if test "${MISSING}" = "" ; then
  1999.     echo You have unpacked all 22 archives.
  2000.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2001. else
  2002.     echo You still must unpack the following archives:
  2003.     echo "        " ${MISSING}
  2004. fi
  2005. exit 0
  2006.  
  2007. exit 0 # Just in case...
  2008.